/*
package com.lagou.dao;

import com.lagou.io.Resources;
import com.lagou.mainMethod.SqlSessionFactoryBuilder;
import com.lagou.mainMethod.sqlSession.SqlSession;
import com.lagou.mainMethod.sqlSessionFactory.SqlSessionFactory;
import com.lagou.pojo.User;

import java.io.InputStream;
import java.util.List;

public class UserDaoImpl implements IUserDao{
    @Override
    public List<User> findAll() throws Exception {
        InputStream resourceAsSteam = Resources.getResourceAsSteam("sqlMapConfig.xml");
        SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(resourceAsSteam);
        SqlSession sqlSession = sqlSessionFactory.openSession();

        //调用
        List<User> users = sqlSession.selectList("user.selectList");
        for (User user1 : users) {
            System.out.println(user1);
        }
        return users;
    }

    @Override
    public User findByCondition(User user) throws Exception {
        InputStream resourceAsSteam = Resources.getResourceAsSteam("sqlMapConfig.xml");
        SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(resourceAsSteam);
        SqlSession sqlSession = sqlSessionFactory.openSession();

        //调用
        User user2 = sqlSession.selectOne("user.selectOne", user);
        return user2;
    }
}
*/
